/**
 * Created by WT-SUN on 2017/6/1.
 */
$(function () {
    var PROJECT_TYPE=CONSTANT.DictionaryTypeDefConstants.PROJECT_TYPE;//项目类型
    var PROJECT_LEVEL=CONSTANT.DictionaryTypeDefConstants.PROJECT_LEVEL;//项目级别
    var PROJECT_SUPERVISION_LEVEL=CONSTANT.DictionaryTypeDefConstants.PROJECT_SUPERVISION_LEVEL;//项目监管级别
    queryComboData(PROJECT_TYPE,'projectTypeQuery');
    queryComboData(PROJECT_LEVEL,'projectLevelQuery');
    queryComboData(PROJECT_SUPERVISION_LEVEL,'supervisionLevelQuery');
    //初始化部门下拉树
    $('.parentDepartmentId').combotree({
        url: ROOT_PATH+'/permission/department/getDepartmentTree.shtml?parentId=0',
        required: true
    });

    //打开人员选择弹窗
    $('#projectDirector').textbox({
        icons: [{
            iconCls: 'icon-search',
            handler: function (e) {
                
            }
        }]
    });
});
/**
 * 获取下拉数据
 * @param code
 * @param queryId
 */
function queryComboData(code,queryId) {
    var pageId='#'+queryId;
    $.ajax({
        type: 'post',
        url: ROOT_PATH + '/permission/dictionary/queryDictionaryByDictionaryTypeCode.shtml',
        data: {code: code},
        dataType: "json",
        success: function (result) {
            $(pageId).combobox({
                data: result,
                valueField: 'id',
                textField: 'text',
                editable: false,
                panelHeight: '200'
            });
        }
    });
}